 import { defineStore } from "./defineStore";
//import { defineStore } from "pinia";
import { ref, computed } from "vue"
export default defineStore("goodsStore", {
  state() {
    return {
      age: 110
    };
  },
  getters: {
    doubleAge() {
      return this.age * 2
    }
  },
  actions: {
    handleClick(value) {
      this.age += value
    }
  }
});
//推荐用第二种方式(组合式的写法)
// export default defineStore("userStore", () => {
//   const count = ref(10)
//   const doubleAge = computed(() => count.value * 2)
//   const handleClick = (value) => {
//     count.value+=value
//   }
//   return { count, doubleAge, handleClick }
// });
